import instance from "../utils/axios_config.js";

export {
    getCategoryPage,
    queryCategory,
    deleCategory,
    editCategory,
    addCategory
}

// 查询列表接口
const getCategoryPage = (params) => {
    return instance({
        url: '/category/list',
        method: 'get',
        params
    })
}

// 编辑页面反查详情接口
const queryCategory = (params) => {
    return instance({
        url: `/category`,
        method: 'get',
        params
    })
}

// 删除当前列的接口
const deleCategory = (id) => {
    return instance({
        url: '/category/' + id,
        method: 'delete'
    })
}

// 修改接口
const editCategory = (params) => {
    return instance({
        url: '/category',
        method: 'put',
        data: {...params}
    })
}

// 新增接口
const addCategory = (params) => {
    return instance({
        url: '/category/add',
        method: 'post',
        data: {...params}
    })
}